home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 2547 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: news.uit.no!news
  2. From: nilss@stud.cs.uit.no (Nils Peter Sudmann)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Removing a patch - solved?
  5. Date: 01 Feb 96 21:50:50 +0100
  6. Organization: University of Tromsoe, Norway
  7. Message-ID: <1128.6605T1310T2548@stud.cs.uit.no>
  8. References: <1996Jan22.150212.23377@ludens> <4e1p58$4l2@misery.millcomm.com>
  9.     <815.6602T1142T756@norconnect.no> <1433.6603T1100T1439@stud.cs.uit.no> <slrn4h17b3.5rq.ing9435@xerxes.to.mh.se>
  10. NNTP-Posting-Host: uit-or6.uit.no
  11. X-Newsreader: THOR 2.22 (Amiga;TCP/IP)
  12.  
  13. On 01-Feb-96 12:01:01, Jimmy Westerlund (ing9435@ind.mh.se) wrote:
  14. >In article <1433.6603T1100T1439@stud.cs.uit.no>, Nils Peter Sudmann wrote:
  15.  
  16. >> The problem is that some program
  17. >>could be executing inside your patched code (and currently waiting for a
  18. >>time slice). AFAIK there is *no* way to safely know when the last thread of
  19. >>control has left your code (and you may unload it). So a patch should
  20. >>actually never remove itself (only render itself inactive). I did miss the
  21. >>previous patch discussion, but I wrote one myself and came to the above
  22. >>conclusion. Right or wrong?
  23.  
  24. > Wouldn't this work:
  25.  
  26. > patch:
  27. >    addq.l    #1,counter
  28.  
  29. >    ; Patch stuff
  30.  
  31. >exit_patch:
  32. >    subq.l    #1,counter
  33. >    rts
  34.  
  35. Nope, if a task-switch occurs just after the jump to 'patch:' *but* before the
  36. addq, you're sold. Same goes for the subq -> rts. I'ill agree that the odds of 
  37. this happening are pretty small. But it is not *correct*.
  38.  
  39. --
  40. Nils Peter Sudmann                  // Using Thor v2.21/#1113, sign v1.5
  41. "Truth, a random variable possibly // EMAIL: nilss@stud.cs.uit.no
  42.  containing complex numbers"      // WWW: http://www.cs.uit.no/~nilss
  43.  
  44.  
  45.